<?php echo $this->Html->css(array(HOST.'/news.seo.pzco'),null,array('inline'=>false));?>

<?php echo $this->Section->main(); ?>
<body>
<div class="container_4">

	<div class="grid_1">
		<div class="logo"><?php echo $this->Html->link($this->Html->image(HOST.'/seo.pzco.logo.png'),'/',array('escape'=>false));?></a></div>
	</div>
	<?php echo $this->element('aktualnosci-promocje')?>
	
	<div class="grid_3">
		
	</div>
	
	<div class="clear"> </div>
	
	<div class="grid_4">
		<?php echo $this->element('menu-top')?>
		<div class="clear"> </div>
	</div>
		
	<div class="clear"> </div>
	
	<div class="grid_4 header">
		<?php echo $this->element('baner')?>
		<div class="clear"> </div>
	</div>	
	
	<div class="clear"> </div>
	<div class="content">
		<div class="grid_1 white">
			<div class="left-text-content">				
				<h2><?php echo __('Kategorie',true)?></h2>
				<div id="news-index-header">
					<div id="categories">
						<ul>
						<?php foreach ($newsGroups as $id => $name) {?>
			            	<li>
			            		<h3>
			            			<?php echo $html->link($name,array('plugin'=>'calendar','controller'=>'news','action'=>'display',$id),array('class'=>(($id == $selectedNewsGroups) ? 'sectionFilter active' : 'sectionFilter')))?>
				           		</h3>
			            	</li>
			            <?php }?>
			        	</ul>
				        <div class="clear"></div>
				    </div>				    
				</div>
			</div>
			<div class="clear"> </div>
			
			<div class="left-text-content">				
				<?php echo $this->Section->generate(1,'calendar-title');?>
				<div id="calendar">&nbsp;</div>
			</div>
			<div class="clear"> </div>
		</div>
		
		<div class="grid_3 white">
			<div class="right-text-content">
				
				<h2><?php echo __('Artykuły',true)?></h2>
				<div id="contentArea" style="width: 100%;">
					
					<?php foreach ($news as $year => $events) {?>
					<div class="one-third-col news-index-cat">
						<h3><?php echo $year?></h3>
							<?php foreach ($events as $key => $event) {?>
							<div class="news-index-item">
								<div class="title"><?php echo $this->Time->format('F j',$event['News']['on_date'])?></div>
								<div>
									<?php echo $html->link($event['News']['name'],array('plugin'=>'calendar','controller'=>'news','action'=>'view',$event['News']['id'],Inflector::slug($event['News']['name'],'-')),array('escape'=>false,'class'=>'fadeLink'))?>
								</div>
								<div class="content-small"><em><?php echo $event['News']['small_content']?></em></div>
							</div>
							<?php }?>
					</div>
					<?php }?>
				
				</div>

				<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>
				<?php $this->Footpanel->install();?>
				<div id="footpanel">
					<ul>
						<li><?php echo $this->Html->link(__('Home', true).'<small>'.__('Home', true).'</small>', array('plugin'=>'calendar','controller'=>'news','action'=>'display'),array('escape'=>false,'class'=>'home')); ?></li>
						<li><?php echo $this->Html->link(__('Add News', true).'<small>'.__('Add News', true).'</small>', 
							array('plugin'=>'calendar','controller'=>'news','action'=>'add'),
							array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_add.png)','onclick'=>"return hs.htmlExpand(this, { objectType: 'iframe', width:860, height:700,title:'Dodaj' } )")); ?></li>					
					</ul>
				</div>
				<?php }?>	
							
			
				<div class="clear"> </div>
			</div>
			<div class="clear"> </div>
		</div>
		<div class="clear"> </div>
	</div>		
	<div class="clear"> </div>
	
	<?php echo $this->element('footer');?>
	<div class="clear"> </div>
</div>
<div class="clear"> </div>
</body>

